<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="HandheldFriendly" content="True">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no">
<meta http-equiv="cleartype" content="on">
<title>test</title>
<!-- ▼Common CSS -->
<link rel="stylesheet" href="wap3.css" />
<!-- ▲Common CSS -->
<style type="text/css">
.custom-image-swiper-single{margin-top: 0.5px};
#main{height:70px}
img{ width:100%;}
  
</style>
<link href="base.css" type="text/css" rel="stylesheet">
</head>
<body>


<div class="c"  style='width:100%'>
	<div class="swiper-container" style="width:100%">
		<div class="swiper-wrapper" style='width:100%'>
			<div class="swiper-slide"  style='width:100%'>
				<a href="javascript:void(0)" style=""> <img class="js-slide-lazy"
					src="head.jpg"   />
				</a>
			</div>
		</div>
	</div>
</div>


<div class="" id='getcode' style="margin-top:-1px;width:100%" >
	<div class="swiper-container" style="" id='main' >
		<div class="swiper-wrapper" style='width:100%'>
			<div class="swiper-slide" style="z-index: 0;" >
			
				<a href="javascript:void(0)" style=""> <img class="js-slide-lazy"
					src="main.jpg"  id="clickgetcode"  />
				</a>
			</div>
			
		</div>
	</div>
</div>

<div class="" id='showcode' style="display:none;margin-top: -1px;width:100%">
	<div class="swiper-container" style="" id='main' >
		<div class="swiper-wrapper" >
			<div class="swiper-slide" style="text-align:center" >
			
				<a href="javascript:void(0)" style="">
				<img class="js-slide-lazy"src="show.jpg" style='' />
				<span style="position:absolute; display:block; margin-top:-15%;color:white;text-align:center;width:100%" id='showcode_hx'></span>
			
				</a>
			</div>
			
			<div class="" style="text-align:center   " >
			  
			</div>
		</div>
	</div>
</div>
<div class="" style="margin-top: -1px;width:100%" >
	<div class="swiper-container" style="">
		<div class="swiper-wrapper">
			<div class="swiper-slide">
				<a href="javascript:void(0)" style=""> <img class="js-slide-lazy"
					src="footer.jpg"  />
				</a>
			</div>
		</div>
	</div>
</div>

	</div>
	<script type="text/javascript" src="jquery-2.0.3.js"></script>
	<script src="base_.js"></script>

<script>
var Cart = {

	getCode : function(){

		
		$("#clickgetcode").bind("click",function(){
			M._alert('恭喜您,领取成功.');
						jQuery("#getcode").hide();
						$('#showcode_hx').html(111111);
						jQuery("#showcode").show();
						return ;
			jQuery.ajax({ 
				type: "post",
				url : url, 
				dataType:'json',
			    data:{'openid':user_code},
				success: function(data){

					if(data.code==0){
						M._alert('恭喜您,领取成功.');
						jQuery("#getcode").hide();
						$('#showcode_hx').html(data.msg);
						jQuery("#showcode").show();
						
					}
					 if(data.code==3){
						M._alert(data.msg);
						jQuery("#getcode").hide();
						$('#showcode_hx').html(data.msg);
						
						jQuery("#showcode").show();
					}

					if(data.code==4){
						M._alert(data.msg);
						jQuery("#getcode").hide();
						$('#showcode_hx').html(data.code_sn);
						
						jQuery("#showcode").show();
					}
				},
			
					error:function(){
						M._alert("服务器出问题了...");
						}
				});
			})
	},

	init : function(){
		Cart.getCode();
		
	},
      getRandCode:function(){
		
		 code = "";   
	     var codeLength = 10;// 
	      
	     var random = new Array(0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R',  
	     'S','T','U','V','W','X','Y','Z');//随机数  
	     for(var i = 0; i < codeLength; i++) {//循环操作  
	        var index = Math.floor(Math.random()*36);//取得随机数的索引（0~35）  
	        code += random[index];//根据索引取得随机数加到code上  
	    }  
	     
	     return code;
	}
};
Cart.init();


/* function copy_code() 
{
	
	var copyText=$('#showcode').html();
    if (window.clipboardData) 
    {
        window.clipboardData.setData("Text",copyText )
    } 
    else 
    {
        var flashcopier = 'flashcopier';
        if(!document.getElementById(flashcopier)) 
        {
          var divholder = document.createElement('div');
          divholder.id = flashcopier;
          document.body.appendChild(divholder);
        }
        document.getElementById(flashcopier).innerHTML = '';
        var divinfo = '<embed src="js/_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(copyText)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
        document.getElementById(flashcopier).innerHTML = divinfo;
    }
	M._alert("复制成功.");
} */

function onBridgeReady(){
	 WeixinJSBridge.call('hideOptionMenu');
	 WeixinJSBridge.call('hideToolbar');
	}

	if (typeof WeixinJSBridge == "undefined"){
	    if( document.addEventListener ){
	        document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
	    }else if (document.attachEvent){
	        document.attachEvent('WeixinJSBridgeReady', onBridgeReady); 
	        document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
	    }
	}else{
	    onBridgeReady();
	}
</script>

</body>
</html>
